﻿<local:MyPage
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
    xmlns:local="clr-namespace:ConstellationShow"
    xmlns:toolkitPrimitives="clr-namespace:Microsoft.Phone.Controls.Primitives;assembly=Microsoft.Phone.Controls.Toolkit"
    x:Class="ConstellationShow.Pages.Setting"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d" d:DesignHeight="768" d:DesignWidth="480"
    shell:SystemTray.IsVisible="True">

	<local:MyPage.Resources>
		<Style x:Key="ToggleSwitchButtonStyle1" TargetType="toolkitPrimitives:ToggleSwitchButton">
			<Setter Property="Background" Value="{StaticResource PhoneBackgroundBrush}"/>
			<Setter Property="IsTabStop" Value="False"/>
			<Setter Property="SwitchForeground" Value="{StaticResource PhoneAccentBrush}"/>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="toolkitPrimitives:ToggleSwitchButton">
						<Border x:Name="Root" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CacheMode="BitmapCache" Opacity="{TemplateBinding Opacity}" Padding="{TemplateBinding Padding}">
							<VisualStateManager.VisualStateGroups>
								<VisualStateGroup x:Name="CommonStates">
									<VisualState x:Name="Normal"/>
									<VisualState x:Name="Disabled">
										<Storyboard>
											<ColorAnimation Duration="0" To="{StaticResource PhoneForegroundColor}" Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)" Storyboard.TargetName="ThumbCenter"/>
											<DoubleAnimation Duration="0" To="0.3" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Root"/>
										</Storyboard>
									</VisualState>
								</VisualStateGroup>
								<VisualStateGroup x:Name="CheckStates">
									<VisualStateGroup.Transitions>
										<VisualTransition GeneratedDuration="0:0:0.05" To="Unchecked"/>
										<VisualTransition GeneratedDuration="0:0:0.05" To="Checked"/>
									</VisualStateGroup.Transitions>
									<VisualState x:Name="Checked">
										<Storyboard>
											<DoubleAnimation Duration="0" To="68" Storyboard.TargetProperty="(TranslateTransform.X)" Storyboard.TargetName="BackgroundTranslation">
												<DoubleAnimation.EasingFunction>
													<ExponentialEase EasingMode="EaseOut" Exponent="15"/>
												</DoubleAnimation.EasingFunction>
											</DoubleAnimation>
											<DoubleAnimation Duration="0" To="68" Storyboard.TargetProperty="(TranslateTransform.X)" Storyboard.TargetName="ThumbTranslation">
												<DoubleAnimation.EasingFunction>
													<ExponentialEase EasingMode="EaseOut" Exponent="15"/>
												</DoubleAnimation.EasingFunction>
											</DoubleAnimation>
											<ColorAnimation Duration="0" To="#FF7F49D1" Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)" Storyboard.TargetName="SwitchBottom" d:IsOptimized="True"/>
										</Storyboard>
									</VisualState>
									<VisualState x:Name="Dragging"/>
									<VisualState x:Name="Unchecked">
										<Storyboard>
											<DoubleAnimation Duration="0" To="0" Storyboard.TargetProperty="(TranslateTransform.X)" Storyboard.TargetName="BackgroundTranslation"/>
											<DoubleAnimation Duration="0" To="0" Storyboard.TargetProperty="(TranslateTransform.X)" Storyboard.TargetName="ThumbTranslation"/>
										</Storyboard>
									</VisualState>
								</VisualStateGroup>
							</VisualStateManager.VisualStateGroups>
							<Grid x:Name="SwitchRoot" Background="Transparent" Height="95" Width="136">
								<Grid x:Name="SwitchTrack" Width="88">
									<Grid x:Name="SwitchBottom"  Height="32" Background="Black">
										<Rectangle x:Name="SwitchBackground" Fill="{TemplateBinding Background}" HorizontalAlignment="Center" Height="20" VerticalAlignment="Center" Width="76">
											<Rectangle.RenderTransform>
												<TranslateTransform x:Name="BackgroundTranslation"/>
											</Rectangle.RenderTransform>
										</Rectangle>
										<Border BorderBrush="{StaticResource PhoneForegroundBrush}" BorderThickness="2">
											<Border BorderThickness="4" BorderBrush="#FFC7B2E7"/>
										</Border>
									</Grid>
									<Border x:Name="SwitchThumb" BorderThickness="4,0" HorizontalAlignment="Left" Height="36" Margin="-4,0" Width="28">
										<Border.RenderTransform>
											<TranslateTransform x:Name="ThumbTranslation"/>
										</Border.RenderTransform>
										<Border x:Name="ThumbCenter" BorderThickness="2" Background="#FF7F49D1" BorderBrush="#FFB196DC"/>
									</Border>
								</Grid>
							</Grid>
						</Border>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<Style x:Key="ToggleSwitchStyle1" TargetType="toolkit:ToggleSwitch">
			<Setter Property="Background" Value="{StaticResource PhoneBackgroundBrush}"/>
			<Setter Property="FontFamily" Value="{StaticResource PhoneFontFamilyLight}"/>
			<Setter Property="FontSize" Value="{StaticResource PhoneFontSizeLarge}"/>
			<Setter Property="Foreground" Value="{StaticResource PhoneForegroundBrush}"/>
			<Setter Property="IsTabStop" Value="False"/>
			<Setter Property="HorizontalContentAlignment" Value="Left"/>
			<Setter Property="SwitchForeground" Value="{StaticResource PhoneAccentBrush}"/>
			<Setter Property="VerticalContentAlignment" Value="Top"/>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="toolkit:ToggleSwitch">
						<Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CacheMode="BitmapCache" Padding="{TemplateBinding Padding}">
							<VisualStateManager.VisualStateGroups>
								<VisualStateGroup x:Name="CommonStates">
									<VisualState x:Name="Normal"/>
									<VisualState x:Name="Disabled">
										<Storyboard>
											<DoubleAnimation Duration="0" To="0.3" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Header"/>
											<DoubleAnimation Duration="0" To="0.3" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Content"/>
										</Storyboard>
									</VisualState>
								</VisualStateGroup>
							</VisualStateManager.VisualStateGroups>
							<Grid Margin="12,5,36,42">
								<Grid.ColumnDefinitions>
									<ColumnDefinition Width="*"/>
									<ColumnDefinition Width="Auto"/>
								</Grid.ColumnDefinitions>
								<Grid.RowDefinitions>
									<RowDefinition Height="Auto"/>
									<RowDefinition Height="Auto"/>
								</Grid.RowDefinitions>
								<ContentControl x:Name="Header" ContentTemplate="{TemplateBinding HeaderTemplate}" Content="{TemplateBinding Header}" Foreground="{StaticResource PhoneSubtleBrush}" FontSize="{StaticResource PhoneFontSizeNormal}" FontFamily="{StaticResource PhoneFontFamilyNormal}" HorizontalAlignment="Left" IsTabStop="False" Margin="-1,0,0,0" Opacity="{TemplateBinding Opacity}" VerticalAlignment="Bottom"/>
								<ContentControl x:Name="Content" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" IsTabStop="False" Margin="-1,1,0,-7" Opacity="{TemplateBinding Opacity}" Grid.Row="1" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
								<toolkitPrimitives:ToggleSwitchButton x:Name="Switch" Background="{TemplateBinding Background}" Grid.Column="1" Margin="-22,-29,-24,-28" Opacity="{TemplateBinding Opacity}" Grid.RowSpan="2" SwitchForeground="{TemplateBinding SwitchForeground}" VerticalAlignment="Bottom" Style="{StaticResource ToggleSwitchButtonStyle1}"/>
							</Grid>
						</Border>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<Style x:Key="ButtonStyle1" TargetType="Button">
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="Button">
						<Grid>
							<ContentPresenter HorizontalAlignment="Center" Content="{TemplateBinding Content}"/>
						</Grid>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
			<Setter Property="FontSize" Value="18.667"/>
			<Setter Property="Foreground" Value="#FF2F0197"/>
		</Style>
	</local:MyPage.Resources>

	<local:MyPage.FontFamily>
		<StaticResource ResourceKey="PhoneFontFamilyNormal"/>
	</local:MyPage.FontFamily>
	<local:MyPage.FontSize>
		<StaticResource ResourceKey="PhoneFontSizeNormal"/>
	</local:MyPage.FontSize>
	<local:MyPage.Foreground>
		<StaticResource ResourceKey="PhoneForegroundBrush"/>
	</local:MyPage.Foreground>

    <!--LayoutRoot 是包含所有页面内容的根网格-->
    <Grid x:Name="LayoutRoot">
        <Grid.Background>
            <ImageBrush Stretch="Fill" ImageSource="/Images/blackground.jpg"/>
        </Grid.Background>
        
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <!--TitlePanel 包含应用程序的名称和页标题-->
        <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">
            <TextBlock x:Name="PageTitle" Text="设置" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}" Foreground="#FF6624C1" FontSize="60"/>
        </StackPanel>

    	<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,8,12,-8">
    		<Grid.ColumnDefinitions>
    			<ColumnDefinition Width="0.64*"/>
    			<ColumnDefinition Width="0.36*"/>
    		</Grid.ColumnDefinitions>
    		<TextBlock Margin="16,10,109,0" TextWrapping="Wrap" Text="启动跳过首页" VerticalAlignment="Top" Foreground="Black" FontSize="26.667"/>
    		<toolkit:ToggleSwitch IsChecked="False" Header="" Height="85" HorizontalAlignment="Left" Margin="21,24,0,0" x:Name="toggleSwitch1" VerticalAlignment="Top" Width="416" Foreground="Black" Background="#FFA37EDC" Style="{StaticResource ToggleSwitchStyle1}" Content="关闭" FontSize="18.667" Grid.ColumnSpan="2" Checked="toggleSwitch1_Checked" Unchecked="toggleSwitch1_Unchecked" />
    		<TextBlock HorizontalAlignment="Left" Margin="17,113,0,0" TextWrapping="Wrap" Text="关注星座" VerticalAlignment="Top" Foreground="Black" FontSize="26.667"/>
    		<Button x:Name="txt" Content="白羊座" Grid.Column="1" Margin="-20,119,19,0" Style="{StaticResource ButtonStyle1}" VerticalAlignment="Top" Click="Button_Click"/>
    	</Grid>
    </Grid>

</local:MyPage>
